package com.ruoyi.system.task;

import com.ruoyi.system.domain.AHousing;
import com.ruoyi.system.mapper.AHousingMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.ruoyi.common.utils.StringUtils;

import java.util.List;

/**
 * 定时任务调度测试
 * 
 * @author ruoyi
 */
@Component("gfTask")
public class GfTask
{
    @Autowired
    private AHousingMapper aHousingMapper;

    public void housingTopTime()
    {
        List<AHousing> aHousings = aHousingMapper.selectAHousingByTopTime();
        if(aHousings.size() > 0){
            for (int i = 0 ;i<aHousings.size() ;i++){
                aHousings.get(i).setIsTop("1");
                aHousings.get(i).setTopTime(null);
                aHousingMapper.updateAHousing(aHousings.get(i));
            }
        }
    }
}
